﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;

namespace ZRT.RHPX.Core.User
{
    public class UserPrincipal : IPrincipal
    {
        private IIdentity IdentityEntity;

        #region 原有属性
        public IIdentity Identity
        {
            get { return this.IdentityEntity; }
            set { this.IdentityEntity = value; }
        }

        public bool IsInRole(string role)
        {
            return false;
        }
        #endregion

        #region 构造函数
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="Entity"></param>
        public UserPrincipal(UserEntity Entity)
        {
            IdentityEntity = new UserIdentity(Entity);
        }
        #endregion 构造函数

        #region 新加属性
        public string Name
        {
            get
            {
                return this.Identity.Name;
            }
        }
        #endregion
    }
}
